/**
 * 项目名：phms3
 * 日期：    2019-11-23 11:17:08
 * Copyright (c) 2015- HTSC-版权所有
 */

package com.joysuch.wwyt.core.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "WWYT_BASE_USER")
@SQLDelete(sql = "update WWYT_BASE_USER set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BASE_USER set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Proxy(lazy = false)
@TableName(value = "WWYT_BASE_USER")
public class BaseUser implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 姓名
    private java.lang.String realName;
    // 租户
    private java.lang.Long tenentId;
    // 性别
    private java.lang.String gender;
    // 出生日期
    private java.util.Date birthday;
    // 曾用名
    private java.lang.String oldName;
    // 身份
    private java.lang.Long role;
    // 工作单位
    private java.lang.Long workCompanyId;
    // 岗位
    private java.lang.Long job;
    // 证件照
    private java.lang.Long idCardImgId;
    // 部门
    private java.lang.Long departId;
    // 工种
    private java.lang.Long workTypeId;
    private String workType;
    // 民族
    private java.lang.Long nation;
    // 证件类型
    private java.lang.Long idCardType;
    // 证件号码
    private java.lang.String idCardNo;
    // 联系电话
    private java.lang.String telephone;
    // 健康状况
    private java.lang.Long healthStatus;
    // 学历
    private java.lang.Long education;
    // 专业
    private java.lang.String major;
    // 户籍所在省
    private java.lang.Long censusRegisterProvince;
    // 户籍所在市
    private java.lang.Long censusRegisterCity;
    // 户籍所在区
    private java.lang.Long censusRegisterArea;
    // 从业所在地省
    private java.lang.Long workAtProvince;
    // 从业所在地市
    private java.lang.Long workAtCity;
    // 从业所在区
    private java.lang.Long workAtArea;
    // 通讯地址
    private java.lang.String address;
    // 邮编
    private java.lang.String postcode;
    // 参加工作时间
    private java.util.Date joinWorkDate;
    // 职称/技能等级
    private java.lang.String title;
    // 工作职责
    private java.lang.String jobDuty;
    // 工作经历
    private java.lang.String jobHistory;
    // 机构代码
    private java.lang.String orgCode;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // columns END
    private String code;
    //邮箱
    private String email;
    //44不显示
    private Integer state;
    //显示顺序
    private Integer showNumber;

    //外部系统关联URL
    private String refUrl;
    //定位卡号
    private String sn;
    //门禁卡号
    private String cardNumber;
    //头像图标
    private String facePic;

    //是否已和人员在岗在位同步数据 默认0 否; 1 是
    private boolean locateSync;
    //人员在岗在位同步过去后返回的id
    private String employeeId;

    private String departName;

    //报警模板id
    private Long alarmTemplateId;

    //人员在岗在位4.x以上同步字段
    private String uniqueId;
    //加入本单位时间
    private Date enterDate;
    //最高学位
    private String highestDegree;
    //毕业学校
    private String graduateSchool;
    //政治面貌
    private Long politicallyId;
    //人员类型
    private Long personTypeId;

    //办公电话
    private String officePhone;
    //工龄
    private Integer workAge;
    //职务
    private String duty;
    //备注
    private String remark;
    //帽子id
    private Long capId;

    //app签名
    private String autograph;

    private String faceToken;

    private String flowSignature;

    private String imei;

    public String getFlowSignature() {
        return flowSignature;
    }

    public void setFlowSignature(String flowSignature) {
        this.flowSignature = flowSignature;
    }

    public String getFaceToken() {
        return faceToken;
    }

    public void setFaceToken(String faceToken) {
        this.faceToken = faceToken;
    }

    public String getAutograph() {
        return autograph;
    }

    public void setAutograph(String autograph) {
        this.autograph = autograph;
    }

    @Column(name = "cap_id")
    public Long getCapId() {
        return capId;
    }

    public void setCapId(Long capId) {
        this.capId = capId;
    }

    @Column(name = "office_phone")
    public String getOfficePhone() {
        return officePhone;
    }

    public void setOfficePhone(String officePhone) {
        this.officePhone = officePhone;
    }

    @Column(name = "IMEI")
    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    @Column(name = "work_age")
    public Integer getWorkAge() {
        return workAge;
    }

    public void setWorkAge(Integer workAge) {
        this.workAge = workAge;
    }

    @Column(name = "duty")
    public String getDuty() {
        return duty;
    }

    public void setDuty(String duty) {
        this.duty = duty;
    }

    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    private String alarmTemplateName;

    @Column(name = "alarm_template_name")
    public String getAlarmTemplateName() {
        return alarmTemplateName;
    }

    public void setAlarmTemplateName(String alarmTemplateName) {
        this.alarmTemplateName = alarmTemplateName;
    }

    @Column(name = "alarm_template_id")
    public Long getAlarmTemplateId() {
        return alarmTemplateId;
    }

    public void setAlarmTemplateId(Long alarmTemplateId) {
        this.alarmTemplateId = alarmTemplateId;
    }

    @Column(name = "show_number")
    public Integer getShowNumber() {
        return showNumber;
    }

    public void setShowNumber(Integer showNumber) {
        this.showNumber = showNumber;
    }

    @Transient
    @Column(name = "depart_name")
    public String getDepartName() {
        return departName;
    }

    public void setDepartName(String departName) {
        this.departName = departName;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public boolean isLocateSync() {
        return locateSync;
    }

    public void setLocateSync(boolean locateSync) {
        this.locateSync = locateSync;
    }

    @Column(name = "state")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(name = "CENSUS", length = 255)
    public String getCensus() {
        return census;
    }

    public void setCensus(String census) {
        this.census = census;
    }

    @Column(name = "WORK", length = 255)
    public String getWork() {
        return work;
    }

    public void setWork(String work) {
        this.work = work;
    }

    //户籍所在地
    private String census;
    //从业所在地
    private String work;

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "REAL_NAME", length = 12, nullable = false)
    public java.lang.String getRealName() {
        return this.realName;
    }

    public void setRealName(java.lang.String value) {
        this.realName = value;
    }

    @Column(name = "CODE", length = 10, nullable = false)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    @Column(name = "GENDER", length = 2)
    public java.lang.String getGender() {
        return this.gender;
    }

    public void setGender(java.lang.String value) {
        this.gender = value;
    }

    @Column(name = "BIRTHDAY")
    public java.util.Date getBirthday() {
        return this.birthday;
    }

    public void setBirthday(java.util.Date value) {
        this.birthday = value;
    }

    @Column(name = "OLD_NAME", length = 12)
    public java.lang.String getOldName() {
        return this.oldName;
    }

    public void setOldName(java.lang.String value) {
        this.oldName = value;
    }

    @Column(name = "ROLE")
    public java.lang.Long getRole() {
        return this.role;
    }

    public void setRole(java.lang.Long value) {
        this.role = value;
    }

    @Column(name = "WORK_COMPANY_ID")
    public java.lang.Long getWorkCompanyId() {
        return this.workCompanyId;
    }

    public void setWorkCompanyId(java.lang.Long value) {
        this.workCompanyId = value;
    }

    @Column(name = "JOB")
    public java.lang.Long getJob() {
        return this.job;
    }

    public void setJob(java.lang.Long value) {
        this.job = value;
    }

    @Column(name = "ID_CARD_IMG_ID")
    public java.lang.Long getIdCardImgId() {
        return this.idCardImgId;
    }

    public void setIdCardImgId(java.lang.Long value) {
        this.idCardImgId = value;
    }

    @Column(name = "DEPART_ID")
    public java.lang.Long getDepartId() {
        return this.departId;
    }

    public void setDepartId(java.lang.Long value) {
        this.departId = value;
    }

    @Column(name = "WORK_TYPE_ID")
    public java.lang.Long getWorkTypeId() {
        return this.workTypeId;
    }

    public void setWorkTypeId(java.lang.Long value) {
        this.workTypeId = value;
    }

    @Column(name = "WORK_TYPE", length = 100)
    public String getWorkType() {
        return workType;
    }

    public void setWorkType(String workType) {
        this.workType = workType;
    }

    @Column(name = "NATION")
    public java.lang.Long getNation() {
        return this.nation;
    }

    public void setNation(java.lang.Long value) {
        this.nation = value;
    }

    @Column(name = "ID_CARD_TYPE")
    public java.lang.Long getIdCardType() {
        return this.idCardType;
    }

    public void setIdCardType(java.lang.Long value) {
        this.idCardType = value;
    }

    @Column(name = "ID_CARD_NO", length = 20)
    public java.lang.String getIdCardNo() {
        return this.idCardNo;
    }

    public void setIdCardNo(java.lang.String value) {
        this.idCardNo = value;
    }

    @Column(name = "TELEPHONE", length = 15)
    public java.lang.String getTelephone() {
        return this.telephone;
    }

    public void setTelephone(java.lang.String value) {
        this.telephone = value;
    }

    @Column(name = "HEALTH_STATUS")
    public java.lang.Long getHealthStatus() {
        return this.healthStatus;
    }

    public void setHealthStatus(java.lang.Long value) {
        this.healthStatus = value;
    }

    @Column(name = "EDUCATION")
    public java.lang.Long getEducation() {
        return this.education;
    }

    public void setEducation(java.lang.Long value) {
        this.education = value;
    }

    @Column(name = "MAJOR", length = 50)
    public java.lang.String getMajor() {
        return this.major;
    }

    public void setMajor(java.lang.String value) {
        this.major = value;
    }

    @Column(name = "CENSUS_REGISTER_PROVINCE")
    public java.lang.Long getCensusRegisterProvince() {
        return this.censusRegisterProvince;
    }

    public void setCensusRegisterProvince(java.lang.Long value) {
        this.censusRegisterProvince = value;
    }

    @Column(name = "CENSUS_REGISTER_CITY")
    public java.lang.Long getCensusRegisterCity() {
        return this.censusRegisterCity;
    }

    public void setCensusRegisterCity(java.lang.Long value) {
        this.censusRegisterCity = value;
    }

    @Column(name = "CENSUS_REGISTER_AREA")
    public Long getCensusRegisterArea() {
        return censusRegisterArea;
    }

    public void setCensusRegisterArea(Long censusRegisterArea) {
        this.censusRegisterArea = censusRegisterArea;
    }

    @Column(name = "WORK_AT_AREA")
    public Long getWorkAtArea() {
        return workAtArea;
    }

    public void setWorkAtArea(Long workAtArea) {
        this.workAtArea = workAtArea;
    }

    @Column(name = "WORK_AT_PROVINCE")
    public java.lang.Long getWorkAtProvince() {
        return this.workAtProvince;
    }

    public void setWorkAtProvince(java.lang.Long value) {
        this.workAtProvince = value;
    }

    @Column(name = "WORK_AT_CITY")
    public java.lang.Long getWorkAtCity() {
        return this.workAtCity;
    }

    public void setWorkAtCity(java.lang.Long value) {
        this.workAtCity = value;
    }

    @Column(name = "ADDRESS", length = 200)
    public java.lang.String getAddress() {
        return this.address;
    }

    public void setAddress(java.lang.String value) {
        this.address = value;
    }

    @Column(name = "POSTCODE", length = 6)
    public java.lang.String getPostcode() {
        return this.postcode;
    }

    public void setPostcode(java.lang.String value) {
        this.postcode = value;
    }

    @Column(name = "JOIN_WORK_DATE")
    public java.util.Date getJoinWorkDate() {
        return this.joinWorkDate;
    }

    public void setJoinWorkDate(java.util.Date value) {
        this.joinWorkDate = value;
    }

    @Column(name = "TITLE", length = 100)
    public java.lang.String getTitle() {
        return this.title;
    }

    public void setTitle(java.lang.String value) {
        this.title = value;
    }

    @Column(name = "JOB_DUTY", length = 300)
    public java.lang.String getJobDuty() {
        return this.jobDuty;
    }

    public void setJobDuty(java.lang.String value) {
        this.jobDuty = value;
    }

    @Column(name = "JOB_HISTORY", length = 500)
    public java.lang.String getJobHistory() {
        return this.jobHistory;
    }

    public void setJobHistory(java.lang.String value) {
        this.jobHistory = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "REF_URL", length = 512)
    public String getRefUrl() {
        return refUrl;
    }

    public void setRefUrl(String refUrl) {
        this.refUrl = refUrl;
    }

    @Column(name = "SN", length = 64)
    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    @Column(name = "CARD_NUMBER", length = 64)
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    @Column(name = "FACE_PIC", length = 512)
    public String getFacePic() {
        return facePic;
    }

    public void setFacePic(String facePic) {
        this.facePic = facePic;
    }


    @Column(name = "enter_date")
    public Date getEnterDate() {
        return enterDate;
    }

    public void setEnterDate(Date enterDate) {
        this.enterDate = enterDate;
    }

    @Column(name = "highest_degree")
    public String getHighestDegree() {
        return highestDegree;
    }

    public void setHighestDegree(String highestDegree) {
        this.highestDegree = highestDegree;
    }

    @Column(name = "graduate_school")
    public String getGraduateSchool() {
        return graduateSchool;
    }

    public void setGraduateSchool(String graduateSchool) {
        this.graduateSchool = graduateSchool;
    }

    @Column(name = "politically_id")
    public Long getPoliticallyId() {
        return politicallyId;
    }

    public void setPoliticallyId(Long politicallyId) {
        this.politicallyId = politicallyId;
    }

    @Column(name = "person_type_id")
    public Long getPersonTypeId() {
        return personTypeId;
    }

    public void setPersonTypeId(Long personTypeId) {
        this.personTypeId = personTypeId;
    }

    private BaseLoginAccount baseLoginAccount;

    @OneToOne(mappedBy = "baseUser", fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
    public BaseLoginAccount getBaseLoginAccount() {
        return this.baseLoginAccount;
    }

    public void setBaseLoginAccount(BaseLoginAccount baseLoginAccount) {
        this.baseLoginAccount = baseLoginAccount;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("realName", getRealName()).append("tenentId", getTenentId()).append("gender", getGender())
                .append("birthday", getBirthday()).append("oldName", getOldName()).append("role", getRole())
                .append("workCompanyId", getWorkCompanyId()).append("job", getJob())
                .append("idCardImgId", getIdCardImgId()).append("departId", getDepartId())
                .append("workTypeId", getWorkTypeId()).append("nation", getNation())
                .append("idCardType", getIdCardType()).append("idCardNo", getIdCardNo())
                .append("telephone", getTelephone()).append("healthStatus", getHealthStatus())
                .append("education", getEducation()).append("major", getMajor())
                .append("censusRegisterProvince", getCensusRegisterProvince()).append("showNumber", getShowNumber())
                .append("censusRegisterCity", getCensusRegisterCity()).append("workAtProvince", getWorkAtProvince())
                .append("workAtCity", getWorkAtCity()).append("address", getAddress()).append("postcode", getPostcode())
                .append("joinWorkDate", getJoinWorkDate()).append("title", getTitle()).append("jobDuty", getJobDuty())
                .append("jobHistory", getJobHistory()).append("orgCode", getOrgCode()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag()).append("imei", getImei()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BaseUser == false)
            return false;
        if (this == obj)
            return true;
        BaseUser other = (BaseUser) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
